package com.hinnotek.amoeba.adapters.old

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hinnotek.amoeba.bean.old.CompanyPersonCostPageBean
import com.hinnotek.amoeba.R

/**
 * 人工成本列表Adapter
 * 2020-10-13,张洋创建
 */
class LaborCostListAdapter :
    BaseQuickAdapter<CompanyPersonCostPageBean, BaseViewHolder>(R.layout.item_labor_cost_list) {
    override fun convert(holder: BaseViewHolder, item: CompanyPersonCostPageBean) {
        if (item.companyPersonCostType == 1) {
            holder.setText(R.id.tv_cost_type_str, "产品")
            holder.setText(R.id.tv, "产品名称:")
            holder.setText(R.id.tv_project_name_str, item.provideProjectName)
            holder.setVisible(R.id.ll_customer_name_str, false)
        } else {
            holder.setText(R.id.tv_cost_type_str, "项目")
            holder.setText(R.id.tv, "项目名称:")
            holder.setText(R.id.tv_project_name_str, item.projectName)
            holder.setText(R.id.tv_customer_name_str, item.customerName)
            holder.setVisible(R.id.ll_customer_name_str, true)
        }
        holder.setText(R.id.tv_amoeba_name_str, item.orgName)
    }
}